@import 'variables.less';

article {
  background: #fff;
  margin-top: 20px;
  padding: 30px;

  &:first-child {
    margin-top: 0;
  }

  &.login-form {
    padding-top: 80px;
    padding-bottom: 80px;

    p, ul {
      font-size: 14px;
    }

    p {
      margin: 1.1rem 0;
    }

    @media screen and (max-width: 969px) { // single-use mobile revisions.
      p, ul {
        line-height: 22px;
      }

      p {
        margin: .7rem 0;
      }

      .help-text {
        margin-top: 1rem;
      }
    }

    .login-button-wrap {
      margin: 3rem 0 1rem;

      .button {
        height: 44px;
        line-height: 1.1;
      }

      @media screen and (min-width: 970px) {
        margin: 1.5rem 0 -0.3rem;

        .button {
          height: 60px;
          width: 350px;
        }
      }
    }

    .help-text {
      font-size: 12px;
      line-height: 18px;
    }

    &.smaller-v-pad {
      padding-top: 20px;
      padding-bottom: 20px;

      .help-text {
        font-size: 11px;
        line-height: 17px;
      }

      li {
        label {
          margin-top: 0.7rem;
        }

        &:first-of-type label {
          margin-top: 1.25rem;
        }
      }
    }
  }

  h1 {
    margin-top: 0;
    padding-top: 0;
  }


}

#deactivated-msg {
  color: #cc0000;
  font-weight: bold;
}

#user-nav {
  margin-top: 64px;
  margin-bottom: 20px;
}

.change-avatar {
  position: relative;

  > .tip {
    background: rgba(0, 0, 0, 0.8);
    color:  #fff;
    display: none;
    margin-top: 5px;
    padding: 10px;
    position: absolute;
    width: 300px;
  }

  &:hover {
    > .tip {
      display: block;
    }
  }
}

#profile {
  padding: 0;

  h1, h2 {
    margin: 0;
  }

  .username {
    color: @textLightGrey;
    font-weight: normal;
  }

  h2 {
    margin-top: 30px;
  }

  .location {
    margin: 0;
    color: @textLightGrey;
    font-weight: normal;
  }

  li {
    margin: 2px 0 5px;
    display: flex;
  }

  .bio,
  .contributions {
    ul {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    p {
      margin: 10px 0;
    }
  }

  .contact {
    label {
      display: inline-block;
      font-weight: bold;
      font-size: 14px;
      padding: 0 10px 0 0;
      text-align: left;
      width: 90px;
    }
  }

  .groups {
    width: 44%;
  }

  .groups,
  .contact {
    ul {
      list-style: none;
      margin: 0;
      padding: 0;
    }
  }

  .badges {
    clear: both;

    ul {
      list-style: none;
      margin: 10px 0 0;
      padding: 0;

      li {
        float: left;
        margin: 0 25px 25px 0;

        img {
          height: 128px;
          width: 128px;
        }
      }
    }
  }

  @media screen and (min-width: 970px) {
    padding: 30px;
  }
}

#admin-actions {
  a.edit {
    background: transparent url(../img/icons.actions.png) no-repeat 4px -21px;
    float: right;
    padding: 0 0 0 18px;
  }
}

.html-rtl {
  #profile {
    .avatar {
      float: right;
    }

    h1.user {
      margin: 2px 60px 0 0;
    }

    h2.location {
      margin: 0 60px 0 0;
    }
  }

  #admin-actions {
    a.edit {
      background-position: right -25px;
      float: left;
      padding: 0 18px 0 0;
    }
  }
}

.pm-or-signout {
  padding: 30px 0;
}

article {
  ul.questions {
    margin-left: 20px;

    li {
      margin: .3em 0;
    }
  }

  form {
    ul {
      margin: 0;
      padding: 0;
    }

    li {
      list-style: none;
      padding: 0;

      input {
        &[type="checkbox"] {
          width: auto;
        }
      }

      img {
        max-width: 100%;
      }

      ul.errorlist {
        margin: 0;
        padding: 0 0 0 140px;

        li {
          margin: 0;
          padding: 0 0 2px;
        }
      }

      &.checkbox {
        label {
          padding: 0 5px 0 168px;
          width: auto;
        }

        input {
          margin: 0 7px 0 0;
        }
      }
    }

    label {
      display: block;
      font-weight: bold;
      font-size: 14px;
      margin: 1.25rem 0 0.25rem;
      text-align: left;
      vertical-align: top;
    }

    div.val-wrap {
      display: inline-block;
      width: 350px;

      input {
        display: block;
      }
    }

    fieldset {
      border: none;
    }
  }

  p.instruct {
    margin: 0 0 15px;
  }
}

.html-rtl {
  article {
    ul.questions {
      margin-left: 0;
      margin-right: 20px;
    }

    form {
      label {
        padding: 0 0 0 5px;
        text-align: left;
      }
    }
  }
}

.edit-watches {
  article {
    form {
      label {
        text-align: left;
        width: auto;
      }
    }
  }
}

#edit-profile-avatar {
  a {
    padding: 0 0 0 .5em;
  }

  ul {
    display: inline-block;
    margin: 0 0 0 .5em;
  }
}

.html-rtl {
  #edit-profile-avatar {
    a {
      padding: 0 .5em 0 0;
    }

    ul {
      margin: 0 .5em 0 0;
    }
  }
}

#change-avatar {
  .helptext {
    display: block;
    margin: 10px 0 0 198px;
  }

  div.val-wrap {
    line-height: 35px;
    margin-right: 10px;
    padding: 0 0 0 10px;
    width: auto;
  }
}

#id_avatar {
  line-height: 35px;
  margin-right: 10px;
  padding: 0 0 0 10px;
  width: auto;
}

.html-rtl {
  #id_avatar,
  #change-avatar div.val-wrap {
    margin-left: 10px;
    margin-right: 0;
    padding: 0 10px 0 0;
  }
}

#flag {
  float: right;

  form {
    margin: 0px;
  }
}

.html-rtl #flag {
  float: left;
}

#avatar-delete {
  .form-actions {
    margin: 1em 0;

    input {
      margin-left: 1em;
    }
  }

  h1 {
    margin-bottom: 1em;
  }
}

.html-rtl {
  #avatar-delete {
    .form-actions {
      input {
        margin-right: 1em;
      }
    }
  }
}

#avatar-preview {
    text-align: center;
}

#edit-settings {
  form {
    label {
      width: 300px;
    }
  }
}

.documents-contributed {
  clear: both;
  margin: 20px 0 0;
}

#username-rules,
#password-rules {
  font-size: 12px;
  width: 45%;
}

#deactivations-log {
  margin-bottom: 24px;
  width: 100%;

  tbody {
    tr {
      &:nth-of-type(2n) {
        background: rgba(255, 255, 255, 0.1);
      }

      &:nth-of-type(2n-1) {
        background: rgba(255, 255, 255, 0.2);
      }
    }
  }

  th {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
  }

  td,
  th {
    padding: 10px;
  }
}

.get-involved-icon {
  background: url('../img/get-involved-icons.png') no-repeat scroll -15px 0px transparent ;
  background-size: 109px 436px;
  float: right;
  height: 59px;
  width: 79px;

  &.questions {
    background-position: -15px -134px;
  }

  &.localize {
    background-position: -15px -352px;
  }
}

.contributor {
  #login {
    display: none;
    margin-top: 40px;
  }

  #login-section {
    h3 {
      text-align: center;
    }

    &.show-form {
      h3 {
        display: none;
      }

      #login {
        display: block;
      }
    }
  }
}

form.deactivate {
  clear: both;
  display: inline-block;
}

#register-form {
  fieldset {
    border: 0;
    margin: 0;
    padding: 0;
  }

  h2 {
    margin-bottom: 0;

    + h4 {
      margin-bottom: 10px;
      margin-top: 5px;
    }
  }

  label {
    font-size: 12px;
    font-weight: bold;
    padding: 0;
    text-align: left;
    width: auto;
  }

  form {
    ul {
      list-style: none;
      margin: 10px 0;
      padding: 0;

      > li {
        min-height: 100px;
      }

      input[type="text"],
      input[type="password"],
      input[type="email"] {
        box-sizing: border-box;
        padding: 10px;
        width: 45%;
      }

      label {
        display: block;
        margin: 10px 0;
      }
    }
  }

  .submit {
    margin: 0;
    padding: 0;

    .btn {
      box-sizing: border-box;
      height: 45px;
      margin-top: 20px;
      width: 45%;
    }
  }

  .validation-label {
    box-sizing: border-box;
    color: #c00;
    display: none;
    float: right;
    margin-top: 10px;
    padding-left: 16px;
    width: 55%;

    &:before {
      content: '\2718'; /* X mark */
      margin-right: 10px;
    }

    &.valid {
      color: #090;

      &:before {
        content: '\2713'; /* Check mark */
      }
    }

    a.ignore-email {
      margin-left: 10px;
    }
  }
}
